var wsUrl = "ws://live.dickycai.top:8812";
var websocket = new WebSocket(wsUrl);
websocket.onopen = function (evt) {
    console.log('open');
};
websocket.onmessage = function (evt) {
    console.log(evt);
    push(evt.data)
};
websocket.onclose = function (evt) {
    console.log(evt);
}
function push(data) {
    data=JSON.parse(data);
    console.log(data);
    var html='<div class="comment">\n' +
        '<span>'+data.user+'</span>' +
        '<span>'+data.content+'</span>' +
        '</div>';
    $("#comments").append(html);
}
